package fh.app4stud.mensa.activities;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import fh.app4stud.mensa.R;
import fh.app4stud.mensa.database.MenuDbAdapter;

import java.util.ArrayList;

/**
 * Tab representing a menu
 * 
 * Created by IntelliJ IDEA. User: ifi Date: 22.04.11 Time: 08:04 To change this
 * template use File | Settings | File Templates.
 */
public class TabMenu1 extends Activity {

	ListView listview;
	ArrayAdapter<String> aa;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		listview = (ListView) findViewById(R.id.tab_list1);
		Bundle extras = getIntent().getExtras();
		ArrayList<String> items;
		if (extras != null) {
			items = extras.getStringArrayList(MenuDbAdapter.KEY_ITEM);
			aa = new ArrayAdapter<String>(this,
					android.R.layout.simple_list_item_1, items);
		}
		listview.setAdapter(aa);
		setContentView(listview);
	}
}
